package com.david.func_test.animinter

import android.animation.ObjectAnimator
import android.app.Activity
import android.os.Bundle
import android.view.View
import android.view.animation.BounceInterpolator
import android.widget.TextView
import com.david.func_test.R
import org.w3c.dom.Text

class AnimIntercepterActivity: Activity() {
    lateinit var title: TextView
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_anim_intercepter)
        title = findViewById(R.id.title)
        title.setOnClickListener {
            startAnim()
        }
    }

    fun startAnim(){
        val objectAnimator = ObjectAnimator.ofFloat(title, View.TRANSLATION_Y, 0f, 100f)
        objectAnimator.duration = 500
//        objectAnimator.interpolator = CustomBounceIntercepter()
//        objectAnimator.interpolator = InterpolationDemo()
        objectAnimator.start()
    }
}